<?php

namespace App\Enums;

use App\Traits\EnumMethods;

enum DnsTtl: int
{
    use EnumMethods;

    case TEN_MINUTE = 600;

    case THIRTY_MINUTE = 1800;

    case ONE_HOUR = 3600;

    case TWELVE_HOUR = 43200;

    case ONE_DAY = 86400;

    const TTL_MAP = [
        600 => '10分钟',
        1800 => '30分钟',
        3600 => '1小时',
        43200 => '12小时',
        86400 => '1天',
    ];

    public function toString(): string
    {
        return self::TTL_MAP[$this->value];
    }
}
